 <template>
          <div class="crumbs">
            <el-breadcrumb separator="/">
                <h3 style="color #DDDDDD">当前位置:考试任务管理/考试任务列表</h3>
            </el-breadcrumb>
        </div>
    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="pkId"
        label="任务编号"
        width="250">
      </el-table-column>
      <el-table-column
        prop="classname"
        label="班级"
        width="250">
      </el-table-column>
      <el-table-column
        prop="classnum"
        label="人数"
        width="250"
        >
      </el-table-column>
      <el-table-column
        prop="curriculumname"
        label="课程"
        width="250"
        >
      </el-table-column>
      <el-table-column
        prop="isopen"
        label="是否开卷"
        width="250"
        >
      </el-table-column>

      <el-table-column
        prop="isopen"
        label="是否考试"
        width="250"
        >
      </el-table-column>
    <el-table-column
    prop="operation"
    label="操作"
     width="250">


        <template #default="scope">


            <el-button type="danger" @click="deleteID(scope.row)">删除</el-button>
        </template>



    </el-table-column>
    </el-table>
     <el-pagination
             background
             @current-change="page"
             current-page.sync="5"
             :page-size="currentPage.limit"
             layout="total, prev, pager, next"
             :total="currentPage.current">
     </el-pagination>

  </template>
<script>
    import {deletegoujiID4, kaoshitaskSetupList} from "../api/index";
    export default {
        created(){
           this.getdata();
        },
        methods: {
          getdata(){
              kaoshitaskSetupList(this.currentPage).then(Object => {
                  this.tableData = Object.records2[0];
                  this.currentPage.current = Object.rowCount2;

              })
          },
            handleClick(row) {
                console.log(row);
            },
            page(currentPage){
                this.currentPage.page=currentPage;
                 this.getdata();
            },
            deleteID(row) {
				
				this.$confirm('确认删除?', '提示', {
				  confirmButtonText: '确定',
				  cancelButtonText: '取消',
				  type: 'warning'
				}).then(() => {	
						deletegoujiID4(row).then(Object => {
							this.getdata();
							this.$message({
								type: 'success',
								message: '删除成功!'
							});
						})
				});
            },
        },
        data() {
            return {
                total: null,
                tableData: null,
                currentPage:{
                  page:1,
                  total:100,
                  count:10,
                  current:0,
                    limit: 10
                }
            }
        }
    }
</script>
